import { useState } from "react"

export default () => {
  // 作为缓存使用
  const [viewResources, setViewResources] = useState({})
  const [currentUser, setCurrentUser] = useState(null)

  const setDataCallback = (data: any) => {
    setViewResources(data)
  }
  const setCurrentUserCallback = (data: any) => {
    setCurrentUser(data)
  }

  return {
    viewResources, 
    setDataCallback,
    currentUser,
    setCurrentUserCallback
  }
}